<?php
namespace app\admin\controller;

\think\Loader::import('controller/Controller', \think\Config::get('traits_path') , EXT);

use app\admin\Controller;

class QueueOrder extends Controller
{
    use \app\admin\traits\controller\Controller;
    // 方法黑名单
    protected static $blacklist = [];

    protected function filter(&$map)
    {
        if ($this->request->param("branchname")) {
            $map['branchname'] = ["like", "%" . $this->request->param("branchname") . "%"];
        }
        if ($this->request->param("bisname")) {
            $map['bisname'] = ["like", "%" . $this->request->param("bisname") . "%"];
        }
        if ($this->request->param("truename")) {
            $map['truename'] = ["like", "%" . $this->request->param("truename") . "%"];
        }
        if ($this->request->param("mobile")) {
            $map['mobile'] = ["like", "%" . $this->request->param("mobile") . "%"];
        }

        if ($this->request->param("queue_time_start") && $this->request->param("queue_time_end")) {

            $queue_time_start = strtotime($this->request->param("queue_time_start"));
            $queue_time_end = strtotime($this->request->param("queue_time_end"));

            $map['queue_time'] = [['>',$queue_time_start],['<',$queue_time_end],'AND'];

        }

        if ($this->request->param("queue_time_start") && !$this->request->param("queue_time_end")) {

            $queue_time_start = strtotime($this->request->param("queue_time_start"));

            $map['queue_time'] = ['>',$queue_time_start];

        }

        if (!$this->request->param("queue_time_start") && $this->request->param("queue_time_end")) {


            $queue_time_end = strtotime($this->request->param("queue_time_end"));

            $map['queue_time'] = ['<',$queue_time_end];

        }


    }
}
